package com.example.demo.service.impl;


import java.util.List;

import com.example.demo.dao.RoleAndPermissionDao;
import com.example.demo.entity.RoleAndPermission;
import com.example.demo.mapper.RoleAndPermissionMapper;
import com.example.demo.service.RoleAndPermissionService;

/**
 * @author Henry.Y
 * @date 2019-05-27
 */
public class RoleAndPermissionServiceImpl implements RoleAndPermissionService{
	
	private RoleAndPermissionMapper roleAndPermissionDao= new RoleAndPermissionDao();

   public int insertRoleAndPermission(RoleAndPermission roleAndPermission){
	   String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.insertRoleAndPermission";
	   return roleAndPermissionDao.insertRoleAndPermission(sqlId, roleAndPermission);
   }
	
	public int insertRoleAndPermissionByList(List<RoleAndPermission> roleAndPermissionList){
		String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.insertRoleAndPermissionByList";
		return roleAndPermissionDao.insertRoleAndPermissionByList(sqlId,roleAndPermissionList);
	}

	public int deleteRoleAndPermission(RoleAndPermission roleAndPermission){
		String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.deleteRoleAndPermission";
		return roleAndPermissionDao.deleteRoleAndPermission(sqlId, roleAndPermission);
	}
	
	public int deleteRoleAndPermissionByRoleList(List<String> roleList){
		String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.deleteRoleAndPermissionByRoleList";
		return roleAndPermissionDao.deleteRoleAndPermissionByRoleList(sqlId, roleList);
	}
	
	public int deleteRoleAndPermissionByPermissionList(List<String> permissionList){
		String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.deleteRoleAndPermissionByPermissionList";                          
		return roleAndPermissionDao.deleteRoleAndPermissionByPermissionList(sqlId,permissionList);
	}                         
	
	public int updateRoleAndPermission(RoleAndPermission roleAndPermission){
		String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.updateRoleAndPermission";
		return roleAndPermissionDao.updateRoleAndPermission(sqlId, roleAndPermission);
	}
	
	public RoleAndPermission selectOneRoleAndPermission(RoleAndPermission roleAndPermission){
		String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.selectOneRoleAndPermission";
		return roleAndPermissionDao.selectOneRoleAndPermission(sqlId, roleAndPermission);
	}
	
	public List<RoleAndPermission> selectRoleAndPermission(){
		String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.selectRoleAndPermission";
		return roleAndPermissionDao.selectRoleAndPermission(sqlId);
	}
	
	public int deleteRoleAndPermissionTable(){
		String sqlId= "com.example.demo.mapper.RoleAndPermissionMapper.deleteRoleAndPermissionTable";
		return roleAndPermissionDao.deleteRoleAndPermission(sqlId);
	}
}
